82454a38e875b796a0dec0e360fe087728ce0cd1,src/test/java/org/passay/IllegalCharacterRuleTest.java,IllegalCharacterRuleTest,passwords,#,32
Before Change
public Object[][] passwords()
throws Exception
{
return
new Object[][] {
{rule, new PasswordData(VALID_PASS), null, },
{
rule,
new PasswordData(INVALID_PASS),
codes(IllegalCharacterRule.ERROR_CODE),
},
};
}
After Change
public Object[][] passwords()
throws Exception
{
return
new Object[][] {
// test valid password
{new IllegalCharacterRule(new char[] {'@', '$'}), new PasswordData("AycDPdsyz"), null, },
// test invalid password
{
new IllegalCharacterRule(new char[] {'@', '$'}),
new PasswordData("AycD@Pdsyz"),
codes(IllegalCharacterRule.ERROR_CODE),
},
// test multiple matches
{
new IllegalCharacterRule(new char[] {'@', '$'}),
new PasswordData("AycD@Pd$yz"),
codes(IllegalCharacterRule.ERROR_CODE, IllegalCharacterRule.ERROR_CODE),
},
// test single match
{
new IllegalCharacterRule(new char[] {'@', '$'}, false),
new PasswordData("AycD@Pd$yz"),
codes(IllegalCharacterRule.ERROR_CODE),
},
// test duplicate matches
{
new IllegalCharacterRule(new char[] {'@', '$'}),
new PasswordData("AycD@Pd$yz@"),
codes(IllegalCharacterRule.ERROR_CODE, IllegalCharacterRule.ERROR_CODE),
},
};
}